package com.example.canteen.converter;

import com.example.canteen.dao.Category;
import com.example.canteen.dto.CategoryDTO;

public class CategoryConverter {
    public static CategoryDTO convertCategory(Category category) {
        CategoryDTO categoryDTO = new CategoryDTO();
        categoryDTO.setName(category.getName());
        categoryDTO.setId(category.getId());
        return categoryDTO;
    }

    public static Category convertCategory(CategoryDTO categoryDTO) {
        Category category = new Category();
        category.setName(categoryDTO.getName());
        category.setId(categoryDTO.getId());
        return category;
    }
}
